home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / clipper / ks94an.zip / INARRAY.HDR < prev    next >
Text File  |  1994-04-25  |  2KB  |  66 lines

  1. /******************************************************************************
  2.                  The Klipper Library, for CA-Clipper 5.x
  3.         Copyright (c), 1994, Wallace Information Systems Engineering
  4.  
  5. FUNCTION:
  6.  
  7. _InArray( axArray, xData ) --> lIsInArray
  8.  
  9. PARAMETERS:
  10.  
  11. axArray : Array of CHAR, DATE, or NUM
  12. cData   : Data to locate
  13.  
  14. SHORT:
  15.  
  16. Determine if a value is in any element of specified array.
  17.  
  18. DESCRIPTION:
  19.  
  20. _InArray() searches the specified array for the data passed in xData.
  21. If found, the function returns TRUE, else FALSE.
  22.  
  23. The array may be of mixed types, any array element incompatible with the
  24. data being looked for is ignored.
  25.  
  26. In the case of character data, the return value is true if xData
  27. appears ANYWHERE in the element.
  28.  
  29. In the case of Date or Numeric, the return value is true only if the
  30. array element EXACTLY EQUALS xData.
  31.  
  32. NOTE:
  33.  
  34. _InArray() does not return the element number associated with the found
  35. value, only whether it is in any of the arrays elements or not.
  36.  
  37. EXAMPLE:
  38.  
  39. LOCAL myarray := { 'One','Two','Three','Four','Five' }
  40.  
  41. t = _InArray(myarray,'Three')
  42. Result: t = TRUE
  43.  
  44. t = _InArray(myarray,'ee')
  45. Result: t = TRUE
  46.  
  47. t = _InArray(myarray,'Seven')
  48. Result: t = FALSE
  49.  
  50.  
  51. LOCAL myarray := { 'One', 1 ,  ctod('01/01/91') }
  52.  
  53. t = _InArray(myarray,'One')
  54. Result: t = TRUE
  55.  
  56. t = _InArray(myarray,1)
  57. Result: t = TRUE
  58.  
  59. t = _InArray(myarray,1.5)
  60. Result: t = FALSE
  61.  
  62. t = _InArray(myarray,ctod('01/01/91') )
  63. Result: t = TRUE
  64.  
  65. ******************************************************************************/
  66.